//#ifndef __ALIAS_H
//#define __ALIAS_H


/************ Defines and Typedefs *****************************************/
/*  #defines and typedefs should have their names in all caps.
 *  Global variables begin with g. Global constants with k. Local
 *  variables should be in all lower case. When initializing
 *  structures and arrays, line everything up in neat columns.
 */
typedef struct alias_ll
{
  char* newCom; // user's new command
  char* cmdLine; // the alias command line of alias when it is set
  char* oldCom; // the original command
  struct alias_ll* next; // the pointer to the next alias linked list
} aliasll; // store the user's new command, the old command, alias commandline, the next pointer

/************ Function Prototypes ******************************************/
// put an alias linked list with others  and sort them
void appendAliasLL(commandT* cmd);
// create an alias linked list from the alias argument and commandline string
// return a pointer to aliasll if successful. Otherwise, return null.
aliasll*  createAliasLL(commandT* cmd);

// check whether the command is already aliased or not
// If yes, return the command that the alias command stands for
// If no, return null.
char* findAliasCmd(char* aliasCmd);
// free all dynamically allocated char in the alias linked list
void freeAliasLL(aliasll* allist);

// unalias the command return true if succeedingm otherwise false.
bool unalias(commandT* cmd);

// print all alias list
void printAlias(void);
